const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
// const BitBarWebpackProgressPlugin = require('bit-bar-webpack-progress-plugin');

module.exports = {
    entry: {
        main: './src/index.tsx',
        vendor: ['react', 'react-dom']
    },
    output: {
        filename: '[name].js',
        path: __dirname + '/dist'
    },
    devtool: 'source-map',
    resolve: {
        extensions: ['.ts', '.tsx', '.js', '.json']
    },
    devServer: {
        port: 8080,
        hot: true
    },
    module: {
        rules: [
            {
                test: /\.tsx?$/, loader: 'awesome-typescript-loader'
            },
            {
                enforce: 'pre', test: /\.js$/, loader: 'source-map-loader'
            }
        ]
    },
    plugins: [
        // new BitBarWebpackProgressPlugin(),
        new HtmlWebpackPlugin({
            title: 'React16App'
        }),
        new webpack.HotModuleReplacementPlugin(),
        new webpack.optimize.CommonsChunkPlugin({
            names: ['vendor']
        })
    ]
}